Multi-scale modelling of location- and frequency-dependent synaptic plasticity induced by transcranial magnetic stimulation in the dendrites of pyramidal neurons

Background: Repetitive transcranial magnetic stimulation (rTMS) induces long-term changes of synapses, but the mechanisms behind these modifications are not fully understood. Although there has been progress in the development of multi-scale modeling tools, no comprehensive module for simulating rTMS-induced synaptic plasticity in biophysically realistic neurons exists.. Objective: We developed a modelling framework that allows the replication and detailed prediction of long-term changes of excitatory synapses in neurons stimulated by rTMS. Methods: We implemented a voltage-dependent plasticity model that has been previously established for simulating frequency-, time-, and compartment-dependent spatio-temporal changes of excitatory synapses in neuronal dendrites. The plasticity model can be incorporated into biophysical neuronal models and coupled to electrical field simulations. Results: We show that the plasticity modelling framework replicates long-term potentiation (LTP)-like plasticity in hippocampal CA1 pyramidal cells evoked by 10-Hz repetitive magnetic stimulation (rMS). This plasticity was strongly distance dependent and concentrated at the proximal synapses of the neuron. We predicted a decrease in the plasticity amplitude for 5 Hz and 1 Hz protocols with decreasing frequency. Finally, we successfully modelled plasticity in distal synapses upon local electrical theta-burst stimulation (TBS) and predicted proximal and distal plasticity for rMS TBS. Notably, the rMS TBS-evoked synaptic plasticity exhibited robust facilitation by dendritic spikes and low sensitivity to inhibitory suppression. Conclusion: The plasticity modelling framework enables precise simulations of LTP-like cellular effects with high spatio-temporal resolution, enhancing the efficiency of parameter screening and the development of plasticity-inducing rTMS protocols.


In brief
Here we develop a validated framework designed for simulating long-term synaptic plasticity induced by TMS.This framework offers accurate predictions of layer-specific effects of rTMSinduced synaptic changes and streamlines the screening of rTMS parameters for inducing synaptic plasticity.

Highlights
• First rigorously validated model of TMS-induced long-term synaptic plasticity in extended neuronal dendrites that goes beyond point-neuron and mean-field modelling

Introduction
Transcranial magnetic stimulation (TMS, [1]) is a widely used brain stimulation method which has shown great promise for the treatment of a variety of neurological conditions [2], including 3/34 Modelling TMS-induced synaptic plasticity Hananeia et al.
stroke [3], pain and drug-resistant depression [4][5][6].Further it is also investigated for the use in tinnitus, epilepsy, Alzheimer's disease [7], Parkinson's disease [8], schizophrenia [9] and other pathologies.Despite its widespread use, there remain significant gaps in scientific understanding about its mechanisms [10,11].As TMS becomes more widespread in both clinical and research applications, it is important to gain a better understanding of the effects of the stimulation at the whole-brain, network, and cellular levels [12,13].
TMS induces a strong electric field in the brain beneath the TMS coil.This electric field can stimulate whole areas of the brain, and will elicit action potentials most likely in the axonal arbor of affected brain cells [13,14].The clinical effects of TMS are related to changes in neuroplasticity [15].However, the links between TMS-induced electric fields, neuronal spiking and long-term synaptic plasticity are not fully understood.TMS has been shown to have a variety of effects on the target area.In the CA1 area alone, TMS has been found to increase intrinsic excitability [16], and to induce or modulate LTP [17][18][19][20][21][22][23][24][25][26] (see also [27][28][29]).Importantly, TMS affects neural tissue through electric fields across the whole neuron, which differs from classical LTP induction protocols based on focal direct electric stimulation [28].To facilitate realistic modelling of LTP induction by TMS, we have used a previously established model of synaptic plasticity [30].This model is particularly suitable for simulating rMS-induced changes of synapses at neuronal dendrites because it can generate detailed spatio-temporal profiles of synaptic plasticity induced by local compartmentspecific voltage threshold-crossing events in the cell such as dendritic spikes, NMDA spikes, large EPSPs, backpropagating somatic spikes, dendritic plateau potentials or combinations thereof [30].
The induction of long-term synaptic potentiation (LTP) by magnetic stimulation has been studied experimentally [31] [32], where magnetic stimulation at 10 Hz induced LTP.This LTP was preferentially located in the proximal dendrites of the cell, with the magnitude of LTP decreasing sharply with further distance from the soma.As there is no cranium in this case, we will henceforth refer to this stimulation as repetitive magnetic stimulation (rMS).
We found that our model, was able to reproduce and better explain the distance-dependent induction of LTP by rMS observed by Lenz et al. [31], as well as to predict a dependence of LTP amplitude on rMS frequency and the ability of rMS to generate LTP in the distal tuft synapses.

Simulation software and code availability
The code will be made available online.For reviewers, a Dropbox link is available here: https: //www.dropbox.com/scl/fo/jk4zcgw3c2jefxj23pu3m/ACoeQcrb6DitMmfDS1WDpb0? rlkey=jjy8b4rvq2z0xk4d4miu0ohhz&st=pylda2tb&dl=0 All NEURON simulations were performed using the 7.8.2 release build of NEURON [33].
NeMo-TMS [34] was run on a modified version of the latest release build (2.0) on MATLAB R2019b.HippoUnit was run using Python 3.9.All simulations and validations were performed on a Windows 10 PC with an Intel Core i9-9900k processor running at 4.7 GHz and 48 GB of RAM.
Since spatial effects are not insignificant in the simulation of magnetic stimulation, simplified point neurons are not appropriate.On the other hand, morphologically fully detailed models are computationally expensive for tuning and running long-term plasticity simulations [35].
Therefore, we implemented our previously established biophysically detailed but morphologically reduced morphology model of the CA1 pyramidal cell [36].This model features branching dendrites in a simplified but anatomically inspired morphology, and has been validated through the HippoUnit test battery [37] including nonlinear dendritic integration and back-propagation of action potentials [36].
For each simulation set, we generated a set of ten models to show the spread of simulation data.To do this, we randomise the synapse locations while keeping the total synaptic input the same.The same set of ten models was used for each simulation set to enable direct comparison.

Computational model of CA1 pyramidal cell
For all simulations here, we implemented a modified form of the biophysically complex but morphologically reduced model [36] of a CA1 pyramidal cell.The axon was modified with an 5/34 Modelling TMS-induced synaptic plasticity Hananeia et al.
axon initial segment and an unmyelinated terminal segment as well as 5 nodes of Ranvier and 6 myelinated inter-nodal segments, as myelin is necessary to facilitate the firing of the cell in response to TMS [14] [34].The axonal initiation of the MS-initiated action potential is shown in Supplementary Figure S3.A schematic of the axon morphology is shown in Supplementary Figure S4.
To ensure that the spiking characteristics were in accordance with realistic behaviour for a CA1 pyramidal cell, the axon initial segment had an elevated sodium conductance as well as elevated K A and K M conductances [38].The values of these conductances were derived by increasing them to a sufficient level where the smaller axon initial segment generated similar electrophysiological properties to the original model with the HippoUnit validation battery (see below, [36]).
A list of the specific channels, their conductances, and the passive properties of the different cell compartments is given in in Supplementary Table 1, with properties that have been modified from the original CA1 pyramidal cell model in bold italics.Three properties were ranged within their given regions and the equations governing their values are given in below Supplementary Table 1.None of these ranged variables have been changed from the original model.

Synaptic models
The excitatory synaptic mechanism used in the plasticity simulations for AMPA/NMDA synapses was the voltage-dependent 4-pathway model of Ebner et al. [30], while for inhibitory synapses the non-plastic Exp2Syn mechanism, with a negative reversal potential of -75 mV was used.
The default parameters for this model were tuned to necortical plasticity data and were not appropriate for a simulation with a larger number of hippocampal synapses.Apart from the parameters in the Ebner model which were derived from direct biophysical measurements, free parameters such as LTP/LTD amplitudes and thresholds were tuned by hand to match the experimental results from Ikegaya et al. [39].Synaptic weights for the excitatory synapses were uniformly random within a given interval; this interval was manually tuned as for the other parameters.Synaptic weights were chosen with a multiplier between 0.22 and 0.44
(the tuned interval).This was multiplied by the default weight factors of 0.5 for presynaptic weights and 2 for postsynaptic weights.For all simulations except where otherwise noted, 128 excitatory synapses and 18 inhibitory synapses were placed in relative numbers according to Megias (2001) [40].A table of parameters for the synaptic plasticity model are shown in Supplementary Table 2.
To examine the effect of different synapse locations on the plasticity, we generated a population of different sets of synapse locations for each simulation.This was done by adjusting the seed of the random number generator.The total input synaptic current for each of these models was kept constant; the choice of weights was the same for each model.The same sets of 10 synapse locations were used for all group results shown, to enable direct comparison between the effects of different stimulation protocols.

Pharmacology in silico
To simulate pharmacological perturbations of the model, the following parameter modifications were made to the model.To simulate bicuculline, the weight of all inhibitory synapses was set to zero.To simulate dendritic TTX application, the conductances of all sodium channels in the dendrites of the cell were set to zero.Similarly, to simulate L-type calcium channel block and total calcium channel block, the conductance of these channels in the cell was set to zero.
As the plasticity model is based on NMDA receptor and calcium dependent mechanisms, the NMDA receptor blockade and calcium channel blockade required additional modifications to the synaptic plasticity model itself.For L-type calcium channel blockade, we set the internal variable N α to zero at each time step, corresponding to the L-type calcium component of presynaptic LTP.NMDA receptor blockade was simulated by setting the parameter S NMDA, representing the NMDA fraction of the combined AMPA-NMDA synapse model to zero (thereby removing the synaptic NMDA component), as well as forcing the internal variable C, representing NMDA receptor activation, to zero at each time step (thereby disabling the internal synaptic plasticity component associated with NMDA activation).As NMDA blockade would also eliminate the postsynaptic calcium influx, we also set the variable N α to zero at each time step.To simulate a calcium-free solution, all calcium influx mechanisms were disabled, as well as calcium-dependent variables within the synaptic model.

Stimulation protocols
When simulating rMS pulses, we also stimulated all Schaffer collateral synapses simultaneously with the application of the rMS pulse to the entire cell.This decision was made based on the assumption that an rMS pulse will cause all (or a large sub-population of) the cells in the target area to fire simultaneously.Given the close proximity of CA1 and CA3, as well as the likelihood that action potentials will be induced in the terminals of axons in the target area without activation of their cell bodies [14], the assumption of near-simultaneous activation of all synapses was implemented in our simulations.To account for the delay in synapse activation, we apply a 1ms delay from the onset of the magnetic stimulus to postsynaptic activation.
In addition to the rMS pulses, we applied a random asynchronous input at 3 Hz to mimic spontaneous neuronal activity in organotypic slice cultures.For the paired local electrical stimulation protocol, a current injection of 3 nA amplitude and 0.5 ms duration was applied to the soma, synchronised with each presynaptic activation.
In the case of the rMS simulations, the TMS waveform generator supplied with NeMo-TMS was used to generate a monophasic waveform with an amplitude 275 V/m, which was 60V/m above the minimum required to induce an action potential, which was synchronised with the presynaptic activation of all Schaffer collateral synapses, with this synaptic activation delayed 1ms after the magnetic stimulus to simulate synaptic activation delay.
Likewise, theta burst stimulation simulations utilised a 250 V/m biphasic waveform with synchronous activation of all synapses.The theta burst stimulation protocol consisted of 15 bursts of 5 stimuli at 100 Hz, with each burst separated by 100 ms.

Validation of the CA1 pyramidal cell model using HippoUnit tests
Because the reduced model of the CA1 cell was augmented with an axon and a realistic axon initial segment to enable it to fire in response to TMS pulses, in addition to importing the model into the NeMo-TMS framework, re-validation using the HippoUnit test battery was required to ensure that our modified model still behaved within acceptable electrophysiological limits for a CA1 pyramidal cell.

All five
HippoUnit tests [36,37] were performed -the somatic features test, the back-propagating action potential test, the depolarisation block test, the PSP attenuation test and the oblique integration test.These tests are described in detail in Tomko et al. [36] and no changes were made to the test settings used for validation in that paper.The resulting final error scores are shown in Supplementary Figure S6.

A module for simulating TMS-induced long-term synaptic plasticity
Existing modelling tools for TMS integrate anatomically and biophysically detailed neuronal models with electric fields induced by TMS, facilitating the simulation of cellular and subcellular voltage and calcium dynamics in response to single and repetitive TMS pulses [14,34,[41][42][43].However, these tools lack the incorporation of experimentally validated plasticity rules necessary for simulating standard LTP induction protocols.To bridge this gap, we have extended the Neuron Modeling for TMS (NeMo-TMS) toolbox (Figure 1) with a comprehensive synaptic plasticity model that incorporates a robust four-pathway approach to synaptic modifications, building on our previously established work [30].This enables the simulation of long-term synaptic changes triggered by local electrical stimulation and rTMS (see below).
We integrated this plasticity model with a reduced model of CA1 pyramidal neurons (Figure 1) that has been validated [36] in a comprehensive testing environment called HippoUnit [35][36][37].
The CA1 pyramidal cell model effectively captures a range of neural activites including somatic spiking, backpropagating action potentials, and dendritic integration of synaptic inputs [36] maintaining a balance between detailed biophysical mechanisms and computational tractability.This integration facilitates the exploration of various LTP/LTD scenarios under rTMS, providing insights into the specific modifications across different anatomical layers and synaptic inputs.for TMS (NeMo-TMS) toolbox integrates detailed neuronal models with TMS-induced electric fields, allowing the simulation of cellular and subcellular voltage and calcium responses during single and repetitive TMS pulses [34].The direction of the electric field is represented by the vector E. We implement in NeMo-TMS a validated model of a CA1 pyramidal cell with detailed biophysics and reduced morphology, capable of generating realistic dendritic and somatic spikes [35,36].Relative dendritic diameters are depicted.We introduced a unified voltage-dependent 4-pathway (2xLTP, 2xLTD) model of long-term synaptic plasticity (yellow circle with pre-and postsynaptic LTP (+) and LTD(-)), capable of reproducing the frequency-, timingand location-dependence of synaptic changes [30], into the existing NeMo-TMS framework.128 of plastic excitatory synapses were placed in the morphology.

Validation of the synaptic plasticity model for LTP/LTD induced by local electrical stimulation
Our main aim was to develop a plasticity modelling framework that would reproduce and explain our previously acquired data on rMS-induced changes of synapses in CA1 pyramidal cells from organotypic slice cultures [31,44].However, the unified voltage-dependent model of synaptic plasticity we chose to use was previously tuned to several predominantly neocortical but not hippocampal plasticity datasets [30].Therefore, we first wanted to test whether the  S2.
As a reference hippocampal dataset, we used the frequency-dependent synaptic weight changes from Ikegaya et al. [39], resulting from the induction of LTP or LTD by local extracellular electrical stimulation.In these experiments, the induced LTP/LTD was measured both in the absence of pharmacological perturbation of the culture, and with the application of bicuculline, a GABA A antagonist that suppresses GABAergic inhibition.To simulate the split between control and bicuculline results, we either enabled or disabled the set of inhibitory synapses (see Methods), with the bicuculline case simulated with zero inhibitory synapses enabled.As in Ikegaya et al. [39], the stimulation protocol was a series of 900 pulses delivered to the Schaffer collaterals at a constant frequency of either 1, 10, 30, or 100 Hz.Inhibitory synapses also received an identical stimulus for the simulations where inhibition was active.
As in our other simulations, there was an additional 3 Hz Poisson random background activity in all synapses to represent the non-silent nature of slice cultures.
Our model produced results within standard deviation for all conditions except for the 1 Hz control case and the 10 Hz inhibition case (Figure 2).In agreement with the data, significant LTP was only induced above 30 Hz.The change in synaptic weights was negligible at frequencies below 10 Hz, a condition that will be compared later with the rMS results.

11/34
These results here indicate that our model can reproduce realistic LTP amplitudes for local electrical stimulation of hippocampal CA1 pyramidal cell synapses.Therefore, the parameters that generated these results (see Table S2) were used for all subsequent simulations.

Synaptic plasticity model simulates and explains experimentally observed proximal LTP induction by rMS
To determine whether our plasticity model would be applicable to a realistic rMS protocol, we aimed to simulate the plasticity data of Lenz et al. [31].In this study, an rMS of 900 pulses at 10 Hz was applied to hippocampal slice cultures, inducing strong LTP in the proximal stratum radiatum of CA1.We modelled this with a train of 900 of NeMo-TMS's monophasic pulses with an amplitude set to 275 V/m, clearly above the minimum firing threshold of the CA1 pyramidal cell model.Each NeMo-TMS pulse was synchronised with the simultaneous activation of all Schaffer collateral synapses, because we assumed that rMS simultaneously activates not only the CA1 pyramidal cell axon but also the presynaptic axons.
The mean Schaffer collateral synaptic weight increased by 30%, with the LTP induction strongly concentrated in the synapses of the proximal dendrites.This was consistent with an experimental observation of a selective potentiation of proximal synapses in CA1 pyramidal cell dendrites following 10 Hz rMS [31].Considering only the proximal synapses of the stratum radiatum (defined here as those in the first half of the apical trunk and associated obliques), an average LTP of 65% was achieved, whereas the distal synapses of the stratum radiatum showed no LTP (Figure 3a).
To predict the frequency-dependence of synaptic plasticity induced by the rMS protocol, we delivered the stimuli at four additional frequencies of 1, 5, 6, 8, and 9 Hz.Proximal LTP was induced, (Figure 3b), with the amount of potentiation increasing with frequency.12/34 Our simulations here showed that rMS was able to induce significant LTP at much lower frequencies than would be required for purely local electrical presynaptic stimulation ( [39], cf. Figure 2).In agreement with experimental data [31], our simulations show that LTP induced by 10 Hz rMS is concentrated in the proximal dendrites, and predict a frequency dependence, with lower frequencies inducing reduced or no LTP.
In additional simulations, biphasic protocol produced less LTP with equivalent stimulation intensity, frequency, and pulse number (Supplementary Figure S1).Increasing stimulation intensity increased LTP amplitude, however these increases became marginal above 300V/m, and no LTP was shown below the cell's somatic firing threshold of 210V/m.(Supplementary Figure S2).

Dependence of proximal rMS-induced LTP on dendritic sodium and synaptic NMDA channels
To better understand the mechanistic basis of the experimental and simulation results, we have tested the effects of in silico pharmacological perturbations on proximal LTP induced by 10 Hz of 900 rMS (Figure 4).Drugs known to reduce the magnitude of rMS-induced LTP [31] include the sodium channel blocker TTX, L-type calcium channel antagonists and general calcium channel antagonists, as well as NMDA receptor antagonists, since both NMDA channels and voltage-gated calcium channels contribute to overall rMS-evoked LTP [31].
Importantly, in agreement with the experimental data [31], in silico suppression (see Methods) of dendritic sodium channels (simulating local TTX application) significantly reduced the amplitude of rMS-induced LTP at all frequencies (Figure 4b).This indicates that our voltagedependent plasticity rule correctly captures the dependence of proximal rMS-induced synaptic potentiation on sodium channel-mediated depolarisation.In fact, all sodium channels, including somatic ones, were blocked in the experiments of Lenz et al.Our simulations indicate that blocking dendritic sodium channels by local application of TTX would be sufficient to suppress the rMS-induced synaptic potentiation.Similarly, deactivation of NMDA receptors 14/34 abolished all synaptic plasticity in the simulations (Figure 4c) as observed in experiments [31].
We also tested in silico (see Methods) the suppression of L-type calcium channels and the use of a completely calcium-free solution, as these pharmacological perturbations have been reported to reduce rMS-evoked LTP [31].Suppression of L-type channels caused a large reduction in the amount of induced LTP, although not a complete abolition, as would be expected from Lenz et al. (Figure 4d).A simulated calcium-free solution completely abolished any plasticity (Figure 4e), in agreement with experiments.Taken together, these data-driven pharmacological perturbations in silico demonstrate that our modelling framework allows for comprehensive mechanistic simulations of TMS-induced plasticity.

Simulations predict distal LTP for theta burst stimulation protocols
Our model has so far shown that 10 Hz rMS produces LTP concentrated in proximal dendritic locations.We wondered under what conditions LTP could be induced in the distal dendrites, particularly in the apical tuft of CA1 pyramidal cells.Specifically, we investigated whether it was possible to induce LTP in the apical tuft, where synapses are typically targeted by axons originating in the perforant path from the entorhinal cortex.
The induction of LTP has been shown to require the presence of dendritic spikes [45], mediated by active sodium channels in the dendrites.Accordingly, the unifying plasticity model of Ebner et al. [30] is capable of generating distal LTP in response to local voltage events that cross local plasticity thresholds but do not elicit dendritic and/or somatic spikes.Following its integration into NeMo-TMS, we investigated whether similar local synaptic plasticity outcomes could be produced by rMS.
First, to replicate the experiments of Kim et al. [45], we applied their local electrical stimulation protocol of 15 bursts of 5 pulses, with each burst delivered at 100 Hz.In these simulations, no inhibition was present because, as in the experiments, to observe LTP in response to perforant path theta burst stimulation, GABA-A receptors had to be blocked pharmacologically [45].
We also neglected the inter-train interval present in the protocols of Kim et al. because our test simulations showed that inter-train intervals had a negligible effect on synaptic plasticity in this model (as we would expect in a model lacking metaplasticity, where inter-train intervals are longer than the time required for the synaptic model to reset), and would only increase the computational time required.In Kim et al.'s experiments, the soma was prevented from spiking; in our simulations, we found that the somatic voltage deflections from the TBS were very small -on the order of 2 mV, which never produced a somatic spike.As a comparison to these local, purely electrical stimuli, we investigated the effect of rMS delivered in a theta-burst fashion.In these cases, the MS-like stimulus was a biphasic pulse delivered at 275 V/m.To account for the fact that rMS would stimulate many presynaptic neurons, synapses in all layers were activated (as in the 10 Hz rMS simulations above), not just those in the perforant path.
We compared the LTP/LTD distance profiles of all four cases -local electrical TBS with and without inhibition, and rMS TBS with and without inhibition (Fig. 5).With local purely 16/34 electrical TBS and no inhibition, LTP was observed in the distal tuft, concentrated at the tips (Fig. 5b).LTP was greatly reduced in the presence of inhibition (Fig. 5a).In contrast to local electrical TBS, we observed LTP not only in proximal branches but also in the distal tuft under an MS-TBS protocol, both in the presence and absence of inhibition (Fig. 5c, 5d).Similar to the 10 Hz rMS protocol, LTP induction was also observed in more proximal synapses, to a similar extent as in the distal tuft.In summary, our simulations reproduce and predict the distal strengthening of synapses by electric and rMS TBS, respectively.We observed the induction of dendritic spikes in the distal tuft when local electrical stimulation was delivered to the perforant path synapses in stratum lacunosum-moleculare. Similarly, we observed large-amplitude voltage depolarizations composed of EPSPs, bAPs and presumably also dendritic spikes, when rMS was delivered to the entire cell (Figures 6b, ,6d).Inhibition 17/34 path, but not with rMS (Figures 6f, 6h).These somatic and dendritic voltage traces show that local depolarisations that exceed local plasticity thresholds in the dendrite can mechanistically explain why local electric TBS induces distal LTP, whereas rMS TBS induces proximal and distal LTP that is less sensitive to synaptic inhibition.

Simulated distal LTP evoked by rMS TBS is dependent on sodium dendritic spikes and less sensitive to inhibition than local electrical TBS
Using local application of TTX, experiments by Kim et al. showed that distal LTP is dependent on sodium dendritic spikes [45].Our model was able to reproduce this result (Fig. 7) providing further validation of the plasticity model.We eliminated dendritic spikes by simulating an application of TTX to the apical dendrites, which deactivates the sodium channels in the apical dendrites but not in the soma.rMS TBS (red) generates LTP even when local electrical TBS (blue) does not.In the presence of simulated GABAergic inhibition, rMS induces LTP comparable to local electrical stimulation without inhibition (i.e.bicuculline simulation).When dendritic sodium spikes are blocked (i.e. when local TTX application is simulated), neither of the two stimulation protocols we tested was able to induce LTP in the dendritic tuft.Sample of 10 models with different randomised synapse locations.
In the absence of inhibition (bicuculline condition), local electrical TBS was able to restore LTP, whereas rMS TBS induced a slightly greater LTP amplitude as compared to the control condition.In contrast to blocking inhibition, the simulated application of TTX abolished LTP under local electrical TBS and also abolished LTP under rMS TBS.
These results show that our model is capable of producing consistent LTP in the distal tuft of pyramidal cells when local electrical or rMS theta-burst stimuli are applied.This represents a successful reproduction of experimental observations in the case of local electrical TBS.It also predicts powerful LTP when using rMS version of the TBS instead.The model also predicts that this distal LTP will be less diminished by the presence of inhibition in the case of rMS than 20/34 in the case of local electrical stimulation.However, in both cases, the presence of dendritic sodium spikes is critical for the induction of LTP.

Discussion
In this work, we have implemented a robust voltage-dependent modelling framework for longterm synaptic plasticity in neurons with extended dendrites.This framework goes beyond point neuron [46] and mean field modelling approaches [47][48][49][50]  Modelling TMS-induced synaptic plasticity at subcellular resolution rMS has previously been shown to induce LTP in a subset of proximal synapses [31].However, there have been no computational tools to simulate and investigate layer-or compartmentspecific rMS-induced synaptic plasticity at a spatio-temporal level with sufficiently high resolution.By incorporating our detailed synaptic plasticity model into the NeMo-TMS, it is now possible to simulate TMS-induced plasticity effects at selected spatial and temporal scales.Previously published tools used neural field theory and STDP modelling [51] to predict long-term synaptic changes in populations of neurons driven by repetitive and paired-pulse TMS protocols [47][48][49][50].This type of modelling allowed estimation of the burst rates and number of pulses per burst that result in synaptic weight changes.However, because neurons were not represented as individual cells with dendrites and axons, but as averaged groups of neurons, layer-specific or compartment specific changes of synapses could not be modelled 21/34 (see also [46]).By combining multi-compartmental neuron modelling with a voltage-based plasticity rule, our work has filled this gap.In addition, while the basic version of NeMo-TMS [34] included very simple synaptic modelling (one strong synapse placed in the apical trunk), our current version of NeMo-TMS allows arbitrary placement of many synapses, with customisable parameters to determine their distribution within the dendrites of neuronal models.This allows for the investigation of location-dependent dynamics and plasticity of synaptic inputs in neuronal somata and dendrites.

Modelling distance-dependent gradients of TMS-induced plasticity in neuronal dendrites
In agreement with experiments [31], our simulations showed strongly distance-dependent synaptic changes induced by rMS, with robust LTP in the proximal synapses.Our voltagedependent plasticity model indicates that proximal LTP can be explained by stronger proximal depolarisation evoked by rMS-evoked backpropagating axonal spikes and their coincidence with proximal postsynaptic responses as compared to distal postsynaptic responses.
Based on the observation of strongly distance-dependent LTP, we asked under what conditions TMS could induce potentiation in distal synapses.We made the prediction that an rMS TBS applied to all synapses and the postsynaptic neuron would generate LTP not only in proximal but also in distal synapses.These predictions can be tested in organotypic hippocampal slice cultures.In these TBS simulations, MS caused the cell to fire in response to almost every stimulus pulse, with little difference with or without inhibition, so the depolarisation at the distal tuft was very similar with or without inhibition.Therefore, because of somatic spike induction, magnetic TBS was able to induce LTP in these distal synapses, unlike local electrical TBS when LTP was blocked by inhibition.However, in the case of TTX simulation (local blockade of dendritic sodium channels), LTP was prevented even with rMS TBS, because inhibition was able to attenuate the backpropagating action potentials from somatic firing, with the backpropagation unable to amplify itself in the absence of sodium channels.

Assumptions about synaptic activity, magnetic fields and neuronal morphology
In this modelling framework, we made a number of physiologically plausible assumptions in both the synaptic model and the presynaptic stimulus.It is known that cells in organotypic slice cultures are not silent [52], so we added a 3 Hz background activity with random jitter to all excitatory and inhibitory synapses.Multielectrode recordings or calcium imaging could be used to better characterise the ongoing neuronal activity in the entorhinal cortex and the CA3 of organotypic slice cultures.Such data could be used to improve the simulations of background synaptic activity.
Similarly, in our simulations, the presynaptic stimulation from both local electric and magnetic stimulation was delivered synchronously to all synapses with a constant delay of 1 ms.In the case of rMS, we believe this is a partially valid assumption because we used a uniform electric field.We assumed that this would have resulted in simultaneous activation of a large proportion of incoming axon terminals.We therefore modelled a simultaneous activation of all synapses, both excitatory and inhibitory.To make these simulations more realistic, random synaptic failures and stochasticity in synaptic delays could be included in the future, based on experimental data.
Furthermore, in our simulations, we imposed the stimulation as a uniform magnetic stimulus.This is a reasonable approximation for simulating neurons in an in vitro environment.However, replicating these results in a more realistic setting including an explicit dish model of the slice culture [53] or a head model and a non-uniform electric field would be an interesting further development due to the spatial heterogeneity and variability of magnetic and electric fields.
It is also worth noting that while our simplified model of the CA1 pyramidal cell closely replicates key dendritic and somatic electrophysiological features of the actual cell [36], it contains significantly less morphological detail than full morphological models of cells.
Therefore, applying the plasticity modelling framework to morphologies with dendrites of realistic diameter and branching may improve simulations of localised dendritic voltage-based plasticity [54].

Metaplasticity, inhibitory plasticity, and clinically relevant stimulation protocols
Future improvements to the NeMo-TMS plasticity modelling framework should include metaplasticity, which is observed as persistent shifts in the threshold of LTP/LTD induction that are caused by prior activity of the cell [55].A modelling implementation of metaplasticity is the BCM (Bienenstock-Cooper-Munro) [56] theory.For stimulation experiments lasting tens of seconds or longer, the combination of a metaplastic model with the current NeMo-TMS plasticity model could increase its predictive power.For example, a BCM-like model based on metaplastic STDP [57][58] could be easily integrated with the current four-pathway voltage-dependent plasticity model.
Including metaplasticity would also be useful for simulating the effect of inter-train intervals [47,50], which we neglect in our TBS simulations.Although originally included in rTMS protocols to avoid overheating the device, they have some effect on plasticity induction [59].
Metaplasticity would also be particularly relevant for investigating the "priming" of inhibitory theta burst stimulation by repetitive magnetic stimulation, where a low-frequency magnetic stimulus is used to prepare larger magnitudes of LTP induction with a subsequent potentiating stimulus.[60] Furthermore, given that the presence or absence of inhibition has a modulatory effect on longterm synaptic plasticity [61][62][63], a more detailed modelling of diverse inhibitory mechanisms would be welcome.Here, we simulated inhibition as being activated simultaneously with excitatory inputs, but simulating feed-forward and feedback inhibition would be more realistic, as the E-I balance in CA1 pyramidal cells depends on complex interactions between different inhibitory cells [64][65][66][67].
As we used non-plastic inhibitory synapses, we also neglected possible contributions of inhibitory plasticity [68][69][70][71].It has been observed in the hippocampus that rMS is able to reduce dendritic but not somatic synaptic inhibition [72].NeMo-TMS may be particularly well suited to simulate such compartment-specific changes of GABAergic synapses.Long-term potentiation facilitated by disinhibition from local interneurons is a topic of active research [73], so a model of rMS that releases the inhibitory brake on excitatory plasticity [74] would be desirable.Importantly, inhibitory plasticity is capable of changing the sign of excitatory 24/34

•
Robust simulations of experimental data on LTP-like plasticity in the proximal dendrites of CA1 hippocampal pyramidal cells evoked by 10 Hz repetitive magnetic stimulation (rMS) • Replication of distal synaptic plasticity for a local electrical theta burst stimulation (TBS) protocol • Prediction of distal and proximal LTP-like plasticity for rMS TBS • 1 Hz rMS does not induce long-term depression 2/34

Figure 1 .
Figure 1.Modelling framework for TMS-induced long-term synaptic plasticity.The Neuron Modeling

10 / 34 Modelling
TMS-induced synaptic plasticity Hananeia et al. plasticity model could reproduce synaptic plasticity data from classical hippocampal CA3-CA1 synapses.This required tuning of the plasticity model.The parameters used are shown in Table

Figure 2 .
Figure 2. Unifying four-pathway model of long-term synaptic plasticity reproduces frequency dependence of synaptic changes in hippocampal CA1 pyramidal cells evoked by local electrical stimulation (a) Local electrical stimulation regions (blue purple and magenta) shown on schematic.(b) Schaffer collateral weight change for 900 pulses delivered at 1, 10, 30, and 100 Hz with inhibition active to simulate (red) control data (blue).(c) Same as b but with inhibition disabled to simulate (red) bicuculline data (blue).

Figure 3 . 34 Figure 3 .
Figure 3.The modelling framework for synaptic plasticity replicates proximal LTP induced by 10 Hz rMS protocol and predicts increasing LTP with increasing frequency.a Schematic of stimulation with electric field vector.(b) Mean LTP in the proximal stratum radiatum decreases with decreasing frequency; the induced LTP for 10 Hz rMS is in agreement with experimental data from Lenz (2015).(See next page.)

Figure 4 .
Figure 4. Pharmacology in silico: rMS-induced LTP depends on dendritic sodium and calcium, as well as synaptic NMDA channels.(a): Schematic of electric field for all panels in this figure.Electric field vector direction shown by E; all regions of the cell are synaptically stimulated.(b): Elimination of LTP when dendritic sodium channels are suppressed, simulating TTX application.(c): Elimination of LTP when NMDA-like processes within the synaptic model are disabled in silico.(d): Large reduction of LTP induction when L-type calcium channels are suppressed in silico.(e): Elimination of LTP observed when calcium-free solution is modelled.

Figure 5 .
Figure 5.The synaptic plasticity model reproduces distal LTP for local electric TBS and predicts proximal and distal LTP for rMS TBS.Induction of LTP by local electrical TBS to the perforant path.(a): Schematic of local electric stimulation for panels b and c.L-M: lacunosum-moleculare (perforant path target).(b): Negligible plasticity observed when inhibition is present.(c): Distal LTP observed when inhibition is absent.(d): Schematic of rMS simulation with electric field vector for panels e and f. (e): LTP in both distal and proximal synapses when rMS is used.Unlike local electrical TBS, rMS TBS is able to induce large LTP when inhibition is present.(f): LTP in both distal and proximal synapses when rMS is simulated and inhibition is disabled.

Figure 6 .
Figure 6.Voltage traces from local electrical and rMS TBS, recorded at the soma and distal apical tuft, account for the outcomes of synaptic plasticity.(a) 100 Hz local electrical TBS only causes small somatic voltage deflections when inhibition is disabled.(b) 100 Hz local electrical TBS induces dendritic spikes when inhibition is disabled.(c) 100 Hz rMS TBS causes multiple somatic spikes.(d) 100 Hz rMS TBS induces dendritic large-amplitude voltage depolarisations when inhibition is disabled.(e) 100 Hz local electrical TBS causes almost no somatic voltage deflection when inhibition is enabled.(f) 100 Hz local electrical TBS does not induce dendritic spikes when inhibition is enabled.(g) 100 Hz rMS TBS causes multiple somatic spikes with inhibition enabled.(h) 100 Hz rMS TBS induces dendritic large-amplitude depolarisations even when inhibition is enabled.

Figure 7 .
Figure 7. Distal LTP induced by simulated rMS is sustained by sodium dendritic spikes but less affected by inhibition than local electrical stimulation.rMSTBS (red) generates LTP even when local electrical TBS (blue) does not.In the presence of simulated GABAergic inhibition, rMS induces LTP comparable to local electrical stimulation without inhibition (i.e.bicuculline simulation).When dendritic sodium spikes are blocked (i.e. when local TTX application is simulated), neither of the two stimulation protocols we tested was able to induce LTP in the dendritic tuft.Sample of 10 models with different randomised synapse locations.
by allowing the simulation of layer and location dependent plasticity effects.Our plasticity simulations in the NeMo-TMS toolbox have provided a better mechanistic and quantitative understanding of experimental results on proximal LTP induced by 10 Hz rMS, including pharmacological perturbations using blockers of synaptic and intrinsic ion channels.We made specific predictions for longterm synaptic plasticity induced by lower frequencies of rMS.In addition, we reproduced experimental data on distal LTP induced by local electrical TBS of perforant path synapses and made predictions for proximal and distal LTP induced by rMS TBS, again including pharmacological perturbations.Moreover, our simulations indicate that 1 Hz rMS does not induce long-term depression.